import platform
import subprocess


class Confing():
    def __init__(self):
        pass

    def get_system(self):
        system = platform.system()
        if system == 'Windows':
            find_types = "findstr"
        else:
            find_types = "grep"
        return find_types

    def get_device_list(self):
        devices = []
        result = subprocess.Popen("adb devices", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.readlines().result.reverse()
        for line in result[1:]:
            if "attached" not in line.strip():
                devices.append(line.split()[0])
            else:
                break
        return devices


